﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Domain.Entity;
using IntelligentAgriculture.WebAPI.Application.Command.VendorModelCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.VendorModelCommandHandler
{
	/// <summary>
	/// 供应商详情
	/// </summary>
	public class DetailVendormodelCommandHandler : IRequestHandler<DetailVendormodelCommand, Results<Vendormodel>>
	{
		private readonly IVendorModelService _vendorModelService;
		/// <summary>
		/// 构造方法
		/// </summary>
		/// <param name="vendorModelService"></param>
		public DetailVendormodelCommandHandler(IVendorModelService vendorModelService)
		{
			_vendorModelService = vendorModelService;
		}
		public async Task<Results<Vendormodel>> Handle(DetailVendormodelCommand request, CancellationToken cancellationToken)
		{
			var vendorModel = await _vendorModelService.DetailVendormodel(request.vendorSnowId);
			return Results<Vendormodel>.DataResult(vendorModel);
		}
	}
}
